From: Keir Fraser Date: Fri, 30 May 2008 15:44:13 +0000 (+0100) Subject: x86 hvm: Fix task-switch operation ordering. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14207^2~2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=8d4e5d626a533220ecf66b6fe88e2179a42d6b48;p=xen.git x86 hvm: Fix task-switch operation ordering. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index f637933899..d6c56d8efe 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1402,14 +1402,14 @@ void hvm_task_switch( hvm_load_segment_selector(v, x86_seg_ldtr, tss.ldt) ) exn_raised = 1; - if ( (tss.trace & 1) && !exn_raised ) - hvm_inject_exception(TRAP_debug, tss_sel & 0xfff8, 0); - rc = hvm_copy_to_guest_virt( tr.base, &tss, sizeof(tss), PFEC_page_present); if ( rc == HVMCOPY_bad_gva_to_gfn ) exn_raised = 1; + if ( (tss.trace & 1) && !exn_raised ) + hvm_inject_exception(TRAP_debug, tss_sel & 0xfff8, 0); + tr.attr.fields.type = 0xb; /* busy 32-bit tss */ hvm_set_segment_register(v, x86_seg_tr, &tr);